<?php 
if (isset($_SESSION["user_id"])) { 
?>
	<ul class="nav nav-tabs nav-justified">
		<li id = "nfo" class="active"><a onclick="displayClose('information','nfo');">Mes Informations</a></li>
		<li id = "hist"><a onclick="displayClose('historique','hist');">Mon Historique</a></li>
		<li id = "myArts"><a onclick="displayClose('myArticles','myArts');">Mes Articles</a></li>
		<li id = "myComs"><a onclick="displayClose('myComments','myComs');">Mes Commentaires</a></li>
		<li id = "myNts"><a onclick="displayClose('myNotes','myNts');">Mes Notes</a></li>
		<li id = "crArt"><a onclick="displayClose('createArticle','crArt');">Proposer son article</a></li>
	</ul>
	<div id = "information" class="main main-tabs clearfix" >
		<?php include_once('informations.html'); ?>
	</div>
	<div id = "historique" class="main main-tabs clearfix" style="display: none">
		<?php include_once('historique.html'); ?>
	</div>
	<div id = "myArticles" class="main main-tabs clearfix" style="display: none">
		<?php include_once('mesArticles.html'); ?>
	</div>
	<div id = "myComments" class="main main-tabs clearfix" style="display: none">
		<?php include_once('mesCommentaires.html'); ?>
	</div>
	<div id = "myNotes" class="main main-tabs clearfix" style="display: none">
		<?php include_once('mesNotes.html'); ?>
	</div>
	<div id = "createArticle" class="main main-tabs clearfix" style="display: none">
		<?php include_once('createArticle.html'); ?>	
	</div>
<?php 
} else { 
?>
    <div class="main">
        <div class="alert alert-danger center-block text-center half-size">
            Vous n'etes pas connecté !
        </div>
    </div>
<?php } ?>

<script type="text/javascript">

CKEDITOR.replace('contentEditor');


function replace(display,close)
{
	var divToClose = document.getElementById(close);
	divToClose.style.display = 'none';
	
	var divToDisplay = document.getElementById(display);
	divToDisplay.style.display = 'block';
}

function displayPage()
{
	var divs = new Array('information','historique','myArticles','myComments','myNotes','createArticle');
	var tabs = new Array('nfo','hist','myArts','myComs','myNts','crArt');
	var i;

	for (i=0; i < 6; i++) {
		if (divs[i] == '<?php if(isset($_GET["page"])) { echo $_GET["page"]; } ?>') {
			var divToDisplay = document.getElementById(divs[i]);
			divToDisplay.style.display = 'block';

			var divActive = document.getElementById(tabs[i]);
			divActive.className = "active";
		}
		else {
			var divToClose = document.getElementById(divs[i]);
			divToClose.style.display = 'none';

			var divActive = document.getElementById(tabs[i]);
			divActive.className = "";
		}
	}
}

function displayClose(display, active)
{
	var divs = new Array('information','historique','myArticles','myComments','myNotes','createArticle');
	var tabs = new Array('nfo','hist','myArts','myComs','myNts','crArt');
	
	for(var i =0; i <6; i++)
	{
		if(tabs[i] == active)
		{
			document.getElementById(active).className = "active";
		}
		else
		{
			document.getElementById(tabs[i]).className = '';
		}
		
		if(divs[i] == display)
		{
			document.getElementById(display).style.display = 'block';
		}		
		else
		{
			document.getElementById(divs[i]).style.display = 'none';
		}
	}
}

</script>